<?php
namespace app\admin\controller;

class Attach extends Base
{
    public function tableCarousel()
    {
        return $this->fetch('carousel');
    }

    public function tableHandleCarousel()
    {
        $data = $this->params;
        $rt = $this->logic()->carousel()->table($data);
        return json_print($rt, '数据获取成功|数据获取失败', 'layui_table');
    }

    public function addCarousel()
    {
        return $this->fetch('add_carousel');
    }

    public function addHandleCarousel()
    {
        $data = $this->params;
        $rt = $this->logic()->carousel()->add($data);
        return json_print($rt, '添加数据成功|添加数据失败');
    }

    public function editCarousel()
    {
        $data = $this->params;
        $detail = $this->logic()->carousel()->detail($data);
        $this->assign('detail', $detail);
        return $this->fetch('edit_carousel');
    }

    public function editHandleCarousel()
    {
        $data = $this->params;
        $rt = $this->logic()->carousel()->edit($data);
        return json_print($rt, '修改数据成功|修改数据失败');
    }

    public function deleteHandleCarousel()
    {
        $data = $this->params;
        $rt = $this->logic()->carousel()->del($data);
        return json_print($rt, '删除数据成功|删除数据失败');
    }


}